﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace EPiBoost.Core.Web.Mvc.Html
{
	internal static class HtmlString
	{ 
		internal static MvcHtmlString GetMvcHtmlString(System.Action<System.IO.TextWriter> action)
		{
			System.Text.StringBuilder builder = new System.Text.StringBuilder();
			using (System.IO.StringWriter writer = new System.IO.StringWriter(builder))
			{
				action(writer);
			}
			if (builder.Length <= 0)
			{
				return MvcHtmlString.Empty;
			}
			return MvcHtmlString.Create(builder.ToString());
		}
	}
}
